package threadpool;

import thread.ThreadUtils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Hollis
 * 在 VM options 中设置 -Xmx8m -Xms8m
 */
public class HollisExecutorDemo {

    private static ExecutorService executor = Executors.newFixedThreadPool(15);

    public static void main(String[] args) {
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            executor.execute(new SubThread());
        }
    }
}

class SubThread implements Runnable {
    @Override
    public void run() {
        ThreadUtils.sleep(10000);
    }
}
